package com.quectel.core.module.forum.entity.mongo;

import com.quectel.core.constants.MongoCollectionConstants;
import com.quectel.util.client.mongo.MongoBaseModel;
import lombok.Data;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.MongoId;

/**
 * @author zhangheng
 * @email nolan.zhang@quectel.com
 * @date 2023/5/8 15:52
 * @description 用户发帖相关数量统计
 */
@Data
@Document(MongoCollectionConstants.FORUM_PERSON_COUNT)
@CompoundIndex(name = "idx_tenant_user", def = "{'tenantId': 1,'mobileUserId': 1}", unique = true, background = true)
@CompoundIndex(name = "idx_post_count_id", def = "{'postCount': -1,'id': -1}", unique = true, background = true)
public class ForumPersonCountModel implements MongoBaseModel {
    /**
     * id
     */
    @MongoId
    private Long id;

    /**
     * 用户Id
     */
    private Long tenantId;

    /**
     * 用户Id
     */
    @Indexed(name = "idx_mobile_user", background = true)
    private Long mobileUserId;

    /**
     * 发帖数量
     */
    private Integer postCount;

    /**
     * 评论数量
     */
    private Integer commentCount;

    /**
     * 点赞数量
     */
    private Integer likeCount;

    /**
     * 分享数量
     */
    private Integer shareCount;


}
